﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iTunesFastForward.LyricsWikiSOAP;
using iTunesLib;

namespace iTunesFastForward.Lyrics
{
    class WikiLyrics
    {
        private LyricWiki _lw;
        private LyricWiki LW
        {
            get
            {
                if (_lw == null)
                {
                    _lw = new LyricWiki();
                }
                return _lw;
            }
        }


        public LyricsDesignation FetchLyricsResults(string artist, string song)
        {
            if (string.IsNullOrEmpty(artist) || string.IsNullOrEmpty(song))
                return null;

            if (LW.checkSongExists(artist, song))
            {
                LyricsResult r = LW.getSong(artist, song);
                return new LyricsDesignation { Artist = r.artist, Lyrics = r.lyrics.Replace("\n", "\r\n"), Song = r.song };
            }
            else
                return null;
        }
    }
}
